const actions = {
    // 设置文件名路劲
    setFileName: ({ commit }, fileName) => {
        return commit('SET_FILENAME', fileName) // 这里使用return 返回 ，返回的是一个promise对象，调用后后面可以接 .then() 继续操作
    },
    // 设置菜单的显示或隐藏
    setMenuVisible: ({ commit }, menuVisible) => {
        return commit('SET_MENUVISIBLE', menuVisible)
    },
    // 设置 设置按钮的显示或隐藏
    setSettingVisible: ({ commit }, settingVisible) => {
        return commit('SET_SETTINGVISIBLE', settingVisible)
    },
    // 设置默认字体的大小
    setDefaultFontSize: ({ commit }, defaultFontSize) => {
        return commit('SET_DEFAULTFONTSIZE', defaultFontSize)
    },
    // 设置当前书的对象
    setCurrentBook: ({ commit }, book) => {
        return commit('SET_CURRENT_BOOK', book)
    },
    // 设置字体设置面板的显示或隐藏
    setFontFamilyVisible: ({ commit }, visible) => {
        return commit('SET_FONT_FAMILY_VISIBLE', visible)
    },
    // 设置字体
    setDefaultFontFamily: ({ commit }, font) => {
        return commit('SET_DEFAULT_FONT_FAMILY', font)
    },
    // 设置默认主题
    setDefaultTheme: ({ commit }, theme) => {
        return commit('SET_DEFAULT_THEME', theme)
    },
    // 设置进度条可拖动
    setBookAvailable: ({ commit }, bookAvailable) => {
        return commit('SET_BOOK_AVAILABLE', bookAvailable)
    },
    // 设置进度条进度
    setProgress: ({ commit }, progress) => {
        return commit('SET_PROGRESS', progress)
    },
    // 设置章节
    setSection: ({ commit }, section) => {
        return commit('SET_SECTION', section)
    },
    setIsPaginating: ({ commit }, isPaginating) => {
        return commit('SET_IS_PAGINATING', isPaginating)
    },
    setNavigation: ({ commit }, navigation) => {
        return commit('SET_NAVIGATION', navigation)
    },
    // 设置封面
    setCover: ({ commit }, cover) => {
        return commit('SET_COVER', cover)
    },
    setMetadata: ({ commit }, metadata) => {
        return commit('SET_METADATA', metadata)
    },
    setPaginate: ({ commit }, paginate) => {
        return commit('SET_PAGINATE', paginate)
    },
    setPagelist: ({ commit }, pagelist) => {
        return commit('SET_PAGELIST', pagelist)
    },
    setIsBookmark({ commit }, isBookmark) {
        return commit('SET_IS_BOOKMARK', isBookmark)
    },
    // 记录手指在书页面中 下拉位置的偏移量 值
    setOffsetY({ commit }, offsetY) {
        return commit('SET_OFFSETY', offsetY)
    }
}

export default actions